<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<?=$this->headStyle()?>
	<?=$this->dojo()?>
</head>
<body class="claro">
	<div dojoType="dojo.data.ItemFileReadStore" id="store"  url="/admin/modules?format=json" jsid="jsonData"></div>
	<script type="text/javascript">	
		dojo.ready(cargarArbolMenu);
		function cargarArbolMenu() {

			var store = new dojo.data.ItemFileWriteStore({
		        url: '/admin/modules?format=json',
		        clearOnClose:true,
		        identifier: 'id',
		        label: 'label',
		        urlPreventCache:true
		    });

			
			store.fetch({
			    onComplete: function(items, request){
			        if(items) {
			            var i;
			            for (i = 0; i < items.length; i++) {
			                var item = items[i];
		  	            }
			        }
			    },
			    queryOptions: {
			        deep: true
			    }
			});
			
			
			var treeModel = new dijit.tree.ForestStoreModel({
			        store: store
			});
			
			var treeControl = new dijit.Tree({
			    model: treeModel,
			    showRoot: false,
			    onClick: function(item){
			    	cargarPanelCentral(item);
		    	},
			    _createTreeNode: function(
			        args) {
			        var tnode = new dijit._TreeNode(args);
			        tnode.labelNode.innerHTML = args.label;
			        return tnode;
			    }        
			},
			'arbolPrincipal');
		}
	</script>
	<div id="arbolPrincipal"></div>
</body>	